package com.jieshuibao.model.domain;

import java.text.NumberFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.List;

import com.jieshuibao.model.db.Counselor;

/**
 * @author Administrator
 *
 */
public class UserDetails extends Counselor   {
	
	private String phoneNumber;//用户手机号

    private Integer role;//用户角色

    private String counselorDuty;//用户职责

    private Integer companyRole;//企业角色

    private String realName;//姓名

    private Integer sex;

    private Date birthdayDate;

    private String address;

    private String province;

    private String companyName;

    private String headImage;

    private Double vipBalance;

    private String position;

    private Date registerDate;
    
    private long time;
    
    private long applyTime;
    
    private String levelName;
    
    private Integer levelMoney;
    
    private HashMap<String, String> adepts;
    
    private String[] accountants;
	
	private String[] taxs;
	
	private String[] lawyers;
	
	private String[] cases;
	 
	private String gender;
	
	private String grScore;//抢答分数
	
	private String adScore;//咨询分数
	
	private String userName;
	
	
	

	public String getUserName() {
		return userName;
	}

	public void setUserName(String userName) {
		this.userName = userName;
	}

	public String getGrScore() {
		Integer grabNum2 = getGrabNum();
		Integer grabScore2 = getGrabScore();
		
		if(grabNum2==null||grabNum2==0||grabScore2==null||grabScore2==0){
			grScore="5";
		}else {
			NumberFormat numberFormat = NumberFormat.getInstance();  
			numberFormat.setMaximumFractionDigits(1);  
			float ad=(float) grabScore2 / (float) grabNum2;
			if(ad>4.5){
				
				grScore = numberFormat.format(ad); 
			}else {
				grScore="4.5";
			}
			
		}
		return grScore;
	}

	public void setGrScore(String grScore) {
	
		this.grScore = grScore;
	}

	public String getAdScore() {
		Integer advNum2 = getAdvNum();
		Integer advScore2 = getAdvScore();
		if(advNum2==null||advScore2==null||advNum2==0||advScore2==0){
			adScore="5";
		}else {
			NumberFormat numberFormat = NumberFormat.getInstance();  
			numberFormat.setMaximumFractionDigits(1);  
			float ad=(float) advScore2 / (float) advNum2;
			if(ad>4.5){
				
				adScore = numberFormat.format((float) advScore2 / (float) advNum2); 
			}else{
				adScore="4.5";
			}
				
		}
		return adScore;
	}

	public void setAdScore(String adScore) {
		
		
		this.adScore = adScore;
	}

	public Integer getLevelMoney() {
		return levelMoney;
	}

	public void setLevelMoney(Integer levelMoney) {
		this.levelMoney = levelMoney;
	}

	private List<Article> articles;
	
	
	public List<Article> getArticles() {
		return articles;
	}

	public void setArticles(List<Article> articles) {
		this.articles = articles;
	}

	public long getApplyTime() {
		return applyTime;
	}

	public void setApplyTime(long applyTime) {
		Date applyDate2 = getApplyDate();
		if(applyDate2!=null){
			applyTime=applyDate2.getTime();
		}
		this.applyTime = applyTime;
	}

	public long getTime() {
		return time;
	}

	public void setTime(long time) {
		
		Date registerDate2 = getRegisterDate();
		if(registerDate2!=null){
			time=registerDate2.getTime();
		}
		this.time = time;
	}

	public String getGender() {
		Integer sex2 = getSex();
		if(sex2!=null){
			if(sex2==0||sex2==1){
				return "男";	
			}else if(sex2==2){
				return "女";	
			}else{
				return "男";	
			}
			
		}
		return gender;	
		
		
	}

	public void setGender(String gender) {
		this.gender = "男";
	}

	public HashMap<String, String> getAdepts() {
		return adepts;
	}

	public void setAdepts(HashMap<String, String> adepts) {
		this.adepts = adepts;
	}

	public String[] getAccountants() {
		 
		String accountantImage2 = getAccountantImage();
		if(accountantImage2!=null&&!accountantImage2.equals("")){
			String replaceAl = accountantImage2.replaceAll("(\"|\\[|\\])", "");
			String[] split = replaceAl.split(",");
			 return split;
		}
		return accountants;
	}

	public void setAccountants(String[] accountants) {
		this.accountants = accountants;
	}

	public String[] getTaxs() {
		String taxImage2 = getTaxImage();
		if(taxImage2!=null&&!taxImage2.equals("")){
			String replaceAl = taxImage2.replaceAll("(\"|\\[|\\])", "");
			String[]  split = replaceAl.split(",");
			 return split;
		}
		return taxs;
	}

	public void setTaxs(String[] taxs) {
		this.taxs = taxs;
	}

	public String[] getLawyers() {
		String lawyerImage2 = getLawyerImage();
		if(lawyerImage2!=null&&!lawyerImage2.equals("")){
			String replaceAl = lawyerImage2.replaceAll("(\"|\\[|\\])", "");
			String[]  split = replaceAl.split(",");
			 return split;
		}
		return lawyers;
	}

	public void setLawyers(String[] lawyers) {
		this.lawyers = lawyers;
	}


	public String[] getCases() {
		
		String caseImages2 = getCaseImages();
		if(caseImages2!=null&&!caseImages2.equals("")){
			String replaceAl = caseImages2.replaceAll("(\"|\\[|\\])", "");
			String[]  split = replaceAl.split(",");
			 return split;
		}
		return cases;
	}

	public void setCases(String[] cases) {
		this.cases = cases;
	}

	public String getPhoneNumber() {
		return phoneNumber;
	}

	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}

	public Integer getRole() {
		return role;
	}

	public void setRole(Integer role) {
		this.role = role;
	}

	public String getCounselorDuty() {
		return counselorDuty;
	}

	public void setCounselorDuty(String counselorDuty) {
		this.counselorDuty = counselorDuty;
	}

	public Integer getCompanyRole() {
		return companyRole;
	}

	public void setCompanyRole(Integer companyRole) {
		this.companyRole = companyRole;
	}

	public String getRealName() {
		return realName;
	}

	public void setRealName(String realName) {
		this.realName = realName;
	}

	public Integer getSex() {
		return sex;
	}

	public void setSex(Integer sex) {
		this.sex = sex;
	}

	public Date getBirthdayDate() {
		return birthdayDate;
	}

	public void setBirthdayDate(Date birthdayDate) {
		this.birthdayDate = birthdayDate;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public String getHeadImage() {
		return headImage;
	}

	public void setHeadImage(String headImage) {
		this.headImage = headImage;
	}

	public Double getVipBalance() {
		return vipBalance;
	}

	public void setVipBalance(Double vipBalance) {
		this.vipBalance = vipBalance;
	}

	public String getPosition() {
		return position;
	}

	public void setPosition(String position) {
		this.position = position;
	}

	public Date getRegisterDate() {
		return registerDate;
	}

	public void setRegisterDate(Date registerDate) {
		this.registerDate = registerDate;
	}

	public String getLevelName() {
		return levelName;
	}

	public void setLevelName(String levelName) {
		this.levelName = levelName;
	}
    
    public static void main(String[] args) {
    	int a=16;
		int b=7;
    	NumberFormat numberFormat = NumberFormat.getInstance();  
	    numberFormat.setMaximumFractionDigits(1);  
	    String result = numberFormat.format((float) a / (float) b); 
	   
		
		float c=a/(float)b;
		System.out.println(c);
		System.out.println(result);
	}
}
